package com.zb.vo;

import com.zb.annotation.NumberPattern;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/28 0028
 **/
@Data
@ApiModel("审核工单备件对象")
public class WorkSpareCheckVo {
    @NotNull(message = "工单备件ID不能为空")
    @ApiModelProperty(value = "工单备件ID", required = true)
    private Long id;

    @Length(max = 200, message = "备注长度限制 200 个字符")
    @ApiModelProperty(value = "备注")
    private String remark;

    @NotNull(message = "收货地址类型不能为空")
    @NumberPattern(regexp = "^(1|2)$", required = true, message = "收货地址类型参数不合法")
    @ApiModelProperty(value = "收货地址类型：1-工单客户地址，2-服务商地址", required = true)
    private Integer receiptAddrType;

    @NotNull(message = "客户/服务商ID参数不能为空")
    @ApiModelProperty(value = "客户/服务商ID", required = true, example = "0")
    private Long userOrNetworkId;

    @NotBlank(message = "收货人姓名不能为空")
    @Length(max = 100, message = "收货人姓名长度限制 100 个字符")
    @ApiModelProperty(value = "收货人姓名", required = true)
    private String receiptName;

    @NotBlank(message = "收货人手机号不能为空")
    @Pattern(regexp = VerificUtil.REGEX_PHONE, message = "收货人手机号格式错误")
    @ApiModelProperty(value = "收货人手机号", required = true)
    private String receiptPhone;

    @NotBlank(message = "收货地址-省不能为空")
    @Length(max = 50, message = "收货地址-省长度限制 50 个字符")
    @ApiModelProperty(value = "收货地址-省", required = true)
    private String receiptProvince;

    @NotBlank(message = "收货地址-市不能为空")
    @Length(max = 50, message = "收货地址-市长度限制 50 个字符")
    @ApiModelProperty(value = "收货地址-市", required = true)
    private String receiptCity;

    @NotBlank(message = "收货地址-县/区不能为空")
    @Length(max = 50, message = "收货地址-县/区长度限制 50 个字符")
    @ApiModelProperty(value = "收货地址-县/区", required = true)
    private String receiptArea;

    @Length(max = 50, message = "收货地址-镇长度限制 50 个字符")
    @ApiModelProperty(value = "收货地址-镇")
    private String receiptTown;

    @NotBlank(message = "收货人详细地址不能为空")
    @Length(max = 200, message = "收货人详细地址长度限制 200 个字符")
    @ApiModelProperty(value = "收货人详细地址", required = true)
    private String receiptAddress;

    @NotNull(message = "旧件处理方式不能为空")
    @NumberPattern(regexp = "^(1|2)$", message = "旧件处理方式参数不合法")
    @ApiModelProperty(value = "旧件处理方式：1-废弃，2-旧件退回", required = true, example = "2")
    private Integer oldCopeWay;

    @ApiModelProperty(value = "旧件退回仓库ID", example = "0")
    private Long storeId;

    @ApiModelProperty(value = "退回仓库仓位ID", example = "0")
    private Long storePositionId;

    @Length(max = 100, message = "旧件收货人姓名长度限制 100 个字符")
    @ApiModelProperty(value = "旧件收货人姓名", example = "")
    private String oldReceiptName;

    @ApiModelProperty(value = "旧件收货人手机号", example = "")
    private String oldReceiptPhone;

    @Length(max = 50, message = "旧件收货地址-省长度限制 50 个字符")
    @ApiModelProperty(value = "旧件收货地址-省", example = "")
    private String oldReceiptProvince;

    @Length(max = 50, message = "旧件收货地址-市长度限制 50 个字符")
    @ApiModelProperty(value = "旧件收货地址-市", example = "")
    private String oldReceiptCity;

    @Length(max = 50, message = "旧件收货地址-县/区长度限制 50 个字符")
    @ApiModelProperty(value = "旧件收货地址-县/区", example = "")
    private String oldReceiptArea;

    @Length(max = 50, message = "旧件收货地址-镇长度限制 50 个字符")
    @ApiModelProperty(value = "旧件收货地址-镇", example = "")
    private String oldReceiptTown;

    @Length(max = 200, message = "旧件收货人详细地址长度限制 200 个字符")
    @ApiModelProperty(value = "旧件收货人详细地址", example = "" )
    private String oldReceiptAddress;

    @NotNull(message = "工单备件物料不能为空")
    @NotEmpty(message = "工单备件物料不能为空")
    @ApiModelProperty(value = "工单备件物料", required = true)
    private List<WorkSpareMaterialCheckVo> workSpareMaterials;

}
